<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>员工注册页面</title>
<link href="/Public/Admin/css/normalize.css" rel="stylesheet">
<link href="/Public/Admin/css/jquery-ui.css" rel="stylesheet">
<link href="/Public/Admin/css/jquery.css" rel="stylesheet" media="screen">
<style type="text/css">
body{font:normal 15px/1.5 Arial, Helvetica, Free Sans, sans-serif;color: #222;background:url(Images/pattern.png);overflow-y:scroll;padding:60px 0 0 0;}
#my-form{width:755px;margin:0 auto;border:1px solid #ccc;padding:3em;border-radius:3px;box-shadow:0 0 2px rgba(0,0,0,.2);}
#comments{width:350px;height:100px;}
</style>
<link type="text/css" href="/Public/Admin/css/b5m-plugin.css" rel="stylesheet">
<link type="text/css" href="/Public/Admin/css/b5m.css" rel="stylesheet">
</head>
<body>
<div class="row">
  <div class="eightcol last ideal-wrap ideal-hidden">
    <!-- Begin Form -->
    <form  class="ideal-form" style="visibility: visible;" id="my-form" action="<?php echo U('Login/register');?>" method="post"><div class="ideal-wrap ideal-tabs ideal-full-width"><ul class="ideal-tabs-wrap"><li class="ideal-tabs-tab ideal-tabs-tab-active"><span>新员工注册</span><i class="ideal-tabs-tab-counter ideal-tabs-tab-counter-zero">0</i></li></ul></div>
    
   	
   
	<input autocomplete="off" name="roleid" value="5" type="hidden">
        <section style="display: block;" class="ideal-tabs-content">
          <div class="ideal-wrap">
             <label style="width: 80px;" class="ideal-label">登录帐号:</label>
             <span class="ideal-field">
                <input autocomplete="off" id="loinname" name="loginname" maxlength="11" type="text">
                <i style="display: none;" class="ideal-icon ideal-icon-valid"></i>
                <i style="display: none;" class="ideal-icon ideal-icon-invalid"></i>
             </span>
             <span style="display: none;" class="ideal-error"></span>
             <span style="color:red">*请输入登录帐号</span>
          </div>
          <div class="ideal-wrap">
             <label style="width: 80px;" class="ideal-label">密码:</label>
                <span class="ideal-field">
                   <input autocomplete="off" id="pass" name="pass" maxlength="11" type="password">
                    <i style="display: none;" class="ideal-icon ideal-icon-valid"></i>
                    <i style="display: none;" class="ideal-icon ideal-icon-invalid"></i>
                 </span>
                 <span style="display: none;" class="ideal-error"></span>
                 <span style="color:red">*请输入6到11位之间的数字、字母、下划线</span>
          </div>
          <div class="ideal-wrap">
              <label style="width: 80px;" class="ideal-label">确认密码:</label>
                <span class="ideal-field">
                  <input autocomplete="off" id="repeatpass" name="repeatpass" type="password">
                  <i style="display: none;" class="ideal-icon ideal-icon-valid"></i>
                  <i style="display: none;" class="ideal-icon ideal-icon-invalid"></i>
                 </span>
                 <span style="display: none;" class="ideal-error"></span>
                 <span style="color:red">*请重复密码</span>
          </div>
          <div class="ideal-wrap">
             <label style="width: 80px;" class="ideal-label">真实姓名:</label>
                <span class="ideal-field">
                 <input autocomplete="off" id="name" name="username" type="text">
                    <i style="display: none;" class="ideal-icon ideal-icon-valid"></i>
                    <i style="display: none;" class="ideal-icon ideal-icon-invalid"></i>
                 </span>
                 <span style="display: none;" class="ideal-error"></span>
                 <span style="color:red">*必填</span>
          </div>
          <div class="ideal-wrap">
          <label style="width: 80px;" class="ideal-label">所在区:</label>
          <select autocomplete="off" name="did" id="depart" onchange="change(this.value)">
             <option selected="selected" value="-1">请选择区</option>
                <option value="1">一区</option>
                <option value="2">二区</option>
                <option value="3">三区</option>
          </select>


        <span style="color:red">*必填</span></div>
        <div class="ideal-wrap">
          <label style="width: 80px;" class="ideal-label">所在部门:</label>
          <select autocomplete="off" id="sector" name="sid">
            <option selected="selected" value="-1">请选择</option>
            <option value="1">一部</option>
            <option value="2">二部</option>
            <option value="3">三部</option>
          </select><span style="color:red">*必填</span>
        </div>
        <div class="ideal-wrap">
          <label style="width: 80px;" class="ideal-label">所在小组:</label>
          <select autocomplete="off" id="groupid" name="gid">
            <option selected="selected" value="-1">请选择</option>
            <option value="1">一组</option>
            <option value="2">二组</option>
            <option value="3">三组</option>
          </select><span style="color:red">*必填</span>
        </div>
        <div class="ideal-wrap">
          <label style="width: 80px;" class="ideal-label">所在小队:</label>
          <select autocomplete="off" id="team" name="tid">
            <option selected="selected" value="-1">请选择</option>
            <option value="1">一队</option>
            <option value="2">二队</option>
            <option value="3">三队</option>
          </select><span style="color:red">*必填</span>
        </div>

        </section><span id="messageid" style="color:red"></span>
        <div class="ideal-wrap ideal-full-width"><div class="ideal-separator"><hr></div></div>

        <div class="ideal-wrap">
        <!-- <button autocomplete="off"  onclick="sub()">提交</button> -->
        <input type="submit" id="sub" value='提交'>
        <button autocomplete="off" id="reset" type="reset">重置</button>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript" src="/Public/Admin/js/jquery-1.js"></script>
<script type="text/javascript" src="/Public/Admin/js/jquery-ui.js"></script>
<script type="text/javascript" src="/Public/Admin/js/jquery.js"></script>
<script type="text/javascript" scr="/Public/Admin/js/jquery-1.8.3.js"></script>
<script type="text/javascript">
// function sub(){
//       var loginname = $("#loinname").val();
//       var pass = $("#pass").val();
//       var repeatpass = $("#repeatpass").val();
//       var name = $("#name").val();
//       var depart = $("#depart").val();
//       var sector = $('#sector').val();
//       var group = $("#groupid").val();
//       var team = $("#team").val();
//       if(loginname==""){
//         alert("帐号不能为空");
//         $("#loinname").focus();
//         return false;
//       }
//       if(pass==""){
//         alert("密码不能为空");
//         $("#pass").focus();
//         return false;
//       }
//       if(pass.length<6||pass.length>11){
//         alert("请输入有效格式的登录密码");
//         return false;
//       }
//       if(repeatpass==""){
//         alert("请输入重复密码");
//         $("#repeatpass").focus();
//         return false;
//       }
//       if(pass!=repeatpass){
//         alert("两次输入的密码不一致,请重新输入");
//         $("#repeatpass").focus();
//         return false;
//       }
//       if(name==""){
//         alert("姓名不能为空");
//         $("#name").focus();
//         return false;
//       }
//       if(depart==-1){
//         alert("请选择所属区");
//         $("#depart").focus();
//         return false;
//       }
//       if(sector==-1){
//         alert("请选择所属部");
//         $("#depart").focus();
//         return false;
//       }
//       if(groupid==-1){
//         alert("请选择所属组");
//         $("#depart").focus();
//         return false;
//       }
//       if(team==-1){
//         alert("请选择所属队");
//         $("#depart").focus();
//         return false;
//       }

//       $("#my-form").submit();
//     }


$("#sub").click(function(){
      var login = true;
      var pass = true;
      var re = true;
      var na = true;
      var de = true;
      var se = true;
      var gr = true;
      var te = true; 
      var loginname = $("#loinname").val();
      var pass = $("#pass").val();
      var repeatpass = $("#repeatpass").val();
      var name = $("#name").val();
      var depart = $("#depart").val();
      var sector = $('#sector').val();
      var group = $("#groupid").val();
      var team = $("#team").val();
      if(loginname==""){
        alert("帐号不能为空");
        $("#loinname").focus();
        login = false;
        return false;
      }
      if(pass==""){
        alert("密码不能为空");
        $("#pass").focus();
        pass = false;
        return false;
      }
      if(pass.length<6||pass.length>11){
        alert("请输入有效格式的登录密码");
        pass = false;
        return false;

      }
      if(repeatpass==""){
        alert("请输入重复密码");
        $("#repeatpass").focus();
        re = false;
        return false;

      }
      if(pass!=repeatpass){
        alert("两次输入的密码不一致,请重新输入");
        $("#repeatpass").focus();
        re = false;
        return false;

      }
      if(name==""){
        alert("姓名不能为空");
        $("#name").focus();
        na = false;
        return false;

      }
      if(depart==-1){
        alert("请选择所属区");
        $("#depart").focus();
        de = false;
        return false;

      }
      if(sector==-1){
        alert("请选择所属部");
        $("#depart").focus();
        se = false;
        return false;

      }
      if(groupid==-1){
        alert("请选择所属组");
        $("#depart").focus();
        gr = false;
        return false;

      }
      if(team==-1){
        alert("请选择所属队");
        $("#depart").focus();
        re = false;
        return false;
        
      }
      if(login && pass && re && na && de && se && gr && te){
        return mySubmit(true); 
      }else{
        return mySubmit(false);  
      }
})
</script>
<div style="text-align:center;">
</div>
</body>
	<script type="text/javascript">
  //       function change(obj){
  //         $.ajax({
  //             type: 'POST',
  //             url: "<?php echo U('Login/group');?>",
  //             data: {departId:obj},
  //             dataType : "json", 
  //             success: function(data) {
  //                 var str = "<option value='0'>请选择</option>";
		// 	      var json = data.groups;
		// 	      for(var i=0;i<json.length;i++){
		// 		     str += "<option value='"+json[i].gid+"'>"+json[i].gname+"</option>"; 
		// 	      }
		// 	      if(str.length==0){
		// 		    str = "<option value='-1'>请选择</option>";
		// 		    $("#groupid").html(str);
		// 	      }
		// 	      $("#groupid").html(str);
                    	 
  //               }
  //           })
		// }

		
	
	</script>

</html>